"""
sub(pattern,repl,str) 用repl 替换str中满足条件的子串
"""
import re

# 将数字替换成###
str1 = "12356abc456def789gda"
pattern = re.compile(r"[0-9]")
repl = "#"

str1 = re.sub(pattern,repl,str1)
print(str1)
